home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / adpipeax / scrmain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-05-04  |  5.3 KB  |  155 lines

  1. VERSION 5.00
  2. Object = "{28D47522-CF84-11D1-834C-00A0249F0C27}#1.0#0"; "ADPIPE.OCX"
  3. Begin VB.MDIForm frmMain 
  4.    BackColor       =   &H8000000C&
  5.    Caption         =   "Mouse Examples"
  6.    ClientHeight    =   4395
  7.    ClientLeft      =   1290
  8.    ClientTop       =   2160
  9.    ClientWidth     =   7275
  10.    LinkTopic       =   "MDIForm1"
  11.    WindowState     =   2  'Maximized
  12.    Begin VB.PictureBox Picture1 
  13.       Align           =   1  'Align Top
  14.       Height          =   975
  15.       Left            =   0
  16.       ScaleHeight     =   915
  17.       ScaleWidth      =   7215
  18.       TabIndex        =   0
  19.       Top             =   0
  20.       Width           =   7275
  21.       Begin AdPipeLibCtl.AdPipea AdPipea1 
  22.          Height          =   900
  23.          Left            =   0
  24.          OleObjectBlob   =   "SCRMAIN.frx":0000
  25.          TabIndex        =   1
  26.          Top             =   0
  27.          Width           =   7020
  28.       End
  29.    End
  30.    Begin VB.Menu mnuOptions 
  31.       Caption         =   "&Options"
  32.       Begin VB.Menu mnuClickLine 
  33.          Caption         =   "&Click-A-Line"
  34.       End
  35.       Begin VB.Menu mnuScribble 
  36.          Caption         =   "&Scribble"
  37.       End
  38.       Begin VB.Menu mnuDragDrop 
  39.          Caption         =   "&Drag and Drop"
  40.       End
  41.       Begin VB.Menu sep1 
  42.          Caption         =   "-"
  43.       End
  44.       Begin VB.Menu mnuInstructions 
  45.          Caption         =   "&Instructions"
  46.       End
  47.       Begin VB.Menu sep2 
  48.          Caption         =   "-"
  49.       End
  50.       Begin VB.Menu mnuExit 
  51.          Caption         =   "E&xit"
  52.       End
  53.    End
  54.    Begin VB.Menu mnuAd 
  55.       Caption         =   "&AdPipe"
  56.       Begin VB.Menu mnuAdVisible 
  57.          Caption         =   "&Visible"
  58.          Checked         =   -1  'True
  59.       End
  60.       Begin VB.Menu mnuAdAlign 
  61.          Caption         =   "&Center"
  62.       End
  63.    End
  64. Attribute VB_Name = "frmMain"
  65. Attribute VB_GlobalNameSpace = False
  66. Attribute VB_Creatable = False
  67. Attribute VB_PredeclaredId = True
  68. Attribute VB_Exposed = False
  69. 'This AdPipe sample was created from a Microsoft
  70. 'VB sample project.  Code in the following subroutines
  71. 'was added or modified:
  72. '   MDIForm_Load
  73. '   MDIForm_Resize
  74. '   AlignAd
  75. '   mnuAdAlign_Click (menus also added)
  76. '   mnuAdVisible_Click (menus also added)
  77. '   Picture1_Resize (picture box also added)
  78. '   theflag (flag used so ad doesn't align on first try)
  79. 'Remember not to alter any properties of the AdPipe control
  80. 'other than the DeveloperID.  You can use the ID 9999 to
  81. 'demo AdPipe's functionality, but before distributing your
  82. 'application, you should register (for free) for your own
  83. 'developer ID so that you can be credited with your user's clicks.
  84. Dim theflag As Integer
  85. Private Sub MDIForm_Load()
  86. 'This section of code checks a flag in the registry.  If 0,
  87. 'the default value, is returned, the flag does not exist, and
  88. 'it can be assumed that the user has not run the program before.
  89. 'If this is the case, a messagebox will be displayed, and the
  90. 'registry flag will be changed so it will not read 0 next time.
  91. 'Adjust height and width for different screen resolutions
  92. AdPipea1.Width = 468 * Screen.TwipsPerPixelX
  93. AdPipea1.Height = 60 * Screen.TwipsPerPixelY
  94. If GetSetting("AdPipe", "History", "FirstRun", "0") = "0" Then
  95.     longstr = "This programs uses AdPipe advertising to keep it's cost to you at a reasonable level.  The next time you're connected to the Internet, it will take a minute or two to download some new ads and contests, but until then you'll see a default image in the advertising space."
  96.     MsgBox longstr, vbOKOnly, "Welcome"
  97.     SaveSetting "AdPipe", "History", "FirstRun", "1"
  98. End If
  99. theflag = 0
  100. End Sub
  101. Private Sub MDIForm_Unload(Cancel As Integer)
  102.     End
  103. End Sub
  104. Private Sub mnuAdAlign_Click()
  105. AlignAd
  106. End Sub
  107. Private Sub mnuAdVisible_Click()
  108. If mnuAdVisible.Checked = True Then
  109.     mnuAdVisible.Checked = False
  110.     Picture1.Visible = False
  111.     mnuAdVisible.Checked = True
  112.     Picture1.Visible = True
  113. End If
  114. End Sub
  115. Private Sub mnuClickLine_Click()
  116.     frmClickLine.Cls
  117. End Sub
  118. Private Sub mnuDragDrop_Click()
  119.     frmDrag.Show
  120. End Sub
  121. Private Sub mnuExit_Click()
  122.     End
  123. End Sub
  124. Private Sub mnuInstructions_Click()
  125.     ' Declare local variables.
  126.     Dim MsgText
  127.     Dim CR
  128.     Dim PB
  129.     ' Initialize paragraph break local variable.
  130.     CR = Chr$(10) & Chr$(13)
  131.     PB = Chr$(10) & Chr$(13) & Chr$(10) & Chr$(13)
  132.     ' Define message text.
  133.     MsgText = "Click-A-Line"
  134.     MsgText = MsgText & CR & "Click the form several times to draw connecting lines."
  135.     MsgText = MsgText & PB & "Scribble"
  136.     MsgText = MsgText & CR & "Drag the mouse across the form to draw a line."
  137.     MsgText = MsgText & PB & "Drag and Drop"
  138.     MsgText = MsgText & CR & "Select a valid text (.txt), bitmap (.bmp), Windows executable (.exe), or Help (.hlp) file in the file list box. Drag the file and drop it into the picture box to display or execute the file."
  139.     ' Display the message.
  140.     MsgBox MsgText, 64, "Mouse Demo Instructions"
  141. End Sub
  142. Private Sub mnuScribble_Click()
  143.     frmScribble.Cls
  144. End Sub
  145. Private Sub AlignAd()
  146.     AdPipea1.Left = (Picture1.Width - AdPipea1.Width) / 2
  147. End Sub
  148. Private Sub Picture1_Resize()
  149. If theflag = 0 Then
  150.     theflag = 1
  151.     Exit Sub
  152. End If
  153. AlignAd
  154. End Sub
  155.